<!--
  
   AffairsScreen.xaml
  
   Copyright (c) 2007 Mike Strobel
  
   This source code is subject to the terms of the Microsoft Reciprocal License (Ms-RL).
   For details, see <http://www.opensource.org/licenses/ms-rl.html>.
  
   All other rights reserved.
  
  -->
<ResourceDictionary xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Supremacy.Client"
                    xmlns:ui="clr-namespace:Supremacy.UI;assembly=SupremacyUI"
                    xmlns:s="clr-namespace:Supremacy.Client;assembly=SupremacyWPF"
                    xmlns:client="clr-namespace:Supremacy.Client;assembly=SupremacyCore"
                    xmlns:scc="http://schemas.startreksupremacy.com/xaml/presentation">

  <Style TargetType="{x:Type local:AffairsScreen}">
    <Setter Property="TextBlock.FontFamily"
            Value="{DynamicResource ParagraphFont}"/>
    <Setter Property="TextBlock.FontSize"
            Value="12pt"/>
    <Setter Property="TextBlock.Foreground"
            Value="{DynamicResource DefaultTextBrush}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:AffairsScreen}">
          <Border Background="#66000000"
                  Padding="6">
            <DockPanel LastChildFill="True">
              <Expander DockPanel.Dock="Left"
                        Header="{s:StringResource Key=EMPIRE_AFFAIRS_INFO, Case=Upper}"
                        Width="240"
                        IsExpanded="True"
                        TextBlock.FontFamily="{DynamicResource DefaultFont}"
                        TextBlock.FontSize="14pt"
                        TextBlock.Foreground="{DynamicResource DefaultTextBrush}"
                        VerticalAlignment="Top">
                <StackPanel Orientation="Vertical"
                            DataContext="{Binding Path=ClientContext.LocalPlayerEmpire.Personnel}">
                  <TextBlock Foreground="{DynamicResource HeaderTextBrush}"
                             Text="{s:StringResource Key=CURRENT_PERSONNEL, Case=Upper}"
                             FontSize="18pt"/>
                  <DockPanel Margin="14,0,0,0">
                    <TextBlock DockPanel.Dock="Left"
                               Foreground="{DynamicResource HeaderTextBrush}"
                               Text="{s:StringResource Key=OFFICERS, Case=Upper}"/>
                    <StackPanel DockPanel.Dock="Right"
                                Orientation="Horizontal"
                                HorizontalAlignment="Right">
                      <TextBlock Text="{Binding Path=Officers.CurrentValue}"/>
                      <TextBlock Text="/"/>
                      <TextBlock Text="{Binding Path=Officers.LastChange}"/>
                    </StackPanel>
                  </DockPanel>
                  <DockPanel Margin="14,0,0,0">
                    <TextBlock DockPanel.Dock="Left"
                               Foreground="{DynamicResource HeaderTextBrush}"
                               Text="{s:StringResource Key=INTERNAL_AFFAIRS, Case=Upper}"/>
                    <StackPanel DockPanel.Dock="Right"
                                Orientation="Horizontal"
                                HorizontalAlignment="Right">
                      <TextBlock Text="{Binding Path=InternalAffairs.CurrentValue}"/>
                      <TextBlock Text="/"/>
                      <TextBlock Text="{Binding Path=InternalAffairs.LastChange}"/>
                    </StackPanel>
                  </DockPanel>
                  <DockPanel Margin="14,0,0,0">
                    <TextBlock DockPanel.Dock="Left"
                               Foreground="{DynamicResource HeaderTextBrush}"
                               Text="{s:StringResource Key=EXTERNAL_AFFAIRS, Case=Upper}"/>
                    <StackPanel DockPanel.Dock="Right"
                                Orientation="Horizontal"
                                HorizontalAlignment="Right">
                      <TextBlock Text="{Binding Path=ExternalAffairs.CurrentValue}"/>
                      <TextBlock Text="/"/>
                      <TextBlock Text="{Binding Path=ExternalAffairs.LastChange}"/>
                    </StackPanel>
                  </DockPanel>
                  <TextBlock Foreground="{DynamicResource HeaderTextBrush}"
                             Text="{s:StringResource Key=PERSONNEL_BONUSES, Case=Upper}"
                             FontSize="18pt"/>
                  <DockPanel Margin="14,0,0,0">
                    <TextBlock DockPanel.Dock="Left"
                               Foreground="{DynamicResource HeaderTextBrush}"
                               Text="{s:StringResource Key=INTERNAL_AFFAIRS, Case=Upper}"/>
                    <StackPanel DockPanel.Dock="Right"
                                Orientation="Horizontal"
                                HorizontalAlignment="Right">
                      <TextBlock Text="{Binding Path=InternalAffairsBonus}"/>
                    </StackPanel>
                  </DockPanel>
                  <DockPanel Margin="14,0,0,0">
                    <TextBlock DockPanel.Dock="Left"
                               Foreground="{DynamicResource HeaderTextBrush}"
                               Text="{s:StringResource Key=EXTERNAL_AFFAIRS, Case=Upper}"/>
                    <StackPanel DockPanel.Dock="Right"
                                Orientation="Horizontal"
                                HorizontalAlignment="Right">
                      <TextBlock Text="{Binding Path=ExternalAffairsBonus}"/>
                    </StackPanel>
                  </DockPanel>
                  <DockPanel Margin="14,0,0,0">
                    <TextBlock DockPanel.Dock="Left"
                               Foreground="{DynamicResource HeaderTextBrush}"
                               Text="{s:StringResource Key=PERSONNEL_LOYALTY, Case=Upper}"/>
                    <StackPanel DockPanel.Dock="Right"
                                Orientation="Horizontal"
                                HorizontalAlignment="Right">
                      <TextBlock Text="{Binding Path=PersonnelLoyaltyBonus}"/>
                    </StackPanel>
                  </DockPanel>
                  <DockPanel Margin="14,0,0,0">
                    <TextBlock DockPanel.Dock="Left"
                               Foreground="{DynamicResource HeaderTextBrush}"
                               Text="{s:StringResource Key=BRIBE_RESISTANCE, Case=Upper}"/>
                    <StackPanel DockPanel.Dock="Right"
                                Orientation="Horizontal"
                                HorizontalAlignment="Right">
                      <TextBlock Text="{Binding Path=BribeResistanceBonus}"/>
                    </StackPanel>
                  </DockPanel>
                </StackPanel>
              </Expander>

              <TabControl Margin="4,0,0,0">
                <TabItem Header="{s:StringResource Key=PERSONNEL, Case=Upper}"
                         DataContext="{Binding Path=ClientContext.LocalPlayerEmpire.Personnel}">
                  <ScrollViewer CanContentScroll="False"
                                HorizontalScrollBarVisibility="Disabled"
                                VerticalScrollBarVisibility="Auto">
                    <Grid Margin="6"
                          TextBlock.FontFamily="{DynamicResource ParagraphFont}"
                          TextBlock.Foreground="{DynamicResource DefaultTextBrush}"
                          TextBlock.FontSize="12pt">
                      <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                      </Grid.RowDefinitions>
                      <StackPanel Grid.Row="0"
                                  VerticalAlignment="Top"
                                  Orientation="Vertical">
                        <!-- OFFICERS -->
                        <DockPanel LastChildFill="True">
                          <Border DockPanel.Dock="Left"
                                  BorderBrush="White"
                                  BorderThickness="2"
                                  CornerRadius="8"
                                  Width="80"
                                  Height="80"
                                  HorizontalAlignment="Left"
                                  VerticalAlignment="Top">
                            <Border.Background>
                              <ImageBrush>
                                <ImageBrush.ImageSource>
                                  <BitmapImage UriSource="vfs:///Resources/UI/Federation/AffairsScreen/Officers.png"/>
                                </ImageBrush.ImageSource>
                              </ImageBrush>
                            </Border.Background>
                          </Border>
                          <StackPanel Orientation="Vertical"
                                      Margin="12,0,0,0">
                            <TextBlock FontFamily="{DynamicResource DefaultFont}"
                                       FontSize="20pt"
                                       Foreground="{DynamicResource HeaderTextBrush}"
                                       Text="{s:StringResource Key=OFFICERS, Case=Upper}"/>
                            <TextBlock Margin="0,12,0,0"
                                       TextWrapping="Wrap"
                                       Text="{Binding Source={s:StringResource OFFICERS_DESCRIPTION}}"/>
                          </StackPanel>
                        </DockPanel>
                        <DockPanel LastChildFill="True"
                                   Margin="0,12,0,0">
                          <ToggleButton DockPanel.Dock="Left"
                                        Focusable="False"
                                        IsTabStop="False"
                                        Margin="0,0,12,0"
                                        Style="{DynamicResource LockToggleButtonStyle}"
                                        IsChecked="{Binding Path=Distribution[Officers].IsLocked, Mode=TwoWay}"/>
                          <RepeatButton DockPanel.Dock="Left"
                                        Margin="0,0,4,0"
                                        Command="{x:Static ui:BlockBar.DecrementCommand}"
                                        CommandTarget="{Binding ElementName=OfficersBlockBar}"
                                        Style="{StaticResource BlockBarDecrementButtonStyle}"/>
                          <TextBlock DockPanel.Dock="Right"
                                     FontFamily="{DynamicResource DefaultFont}"
                                     FontSize="20pt"
                                     Width="50"
                                     TextAlignment="Right"
                                     Text="{Binding Path=Distribution[Officers].Value}"/>
                          <RepeatButton DockPanel.Dock="Right"
                                        Margin="4,0,0,0"
                                        Command="{x:Static ui:BlockBar.IncrementCommand}"
                                        CommandTarget="{Binding ElementName=OfficersBlockBar}"
                                        Style="{StaticResource BlockBarIncrementButtonStyle}"/>
                          <ui:BlockBar x:Name="OfficersBlockBar"
                                       Height="28" 
                                       BlockCount="48"
                                       BlockMargin="4"
                                       Value="{Binding Path=Distribution[Officers].Value, Mode=TwoWay}"/>
                        </DockPanel>
                      </StackPanel>

                      <!-- INTERNAL AFFAIRS -->
                      <StackPanel Grid.Row="1"
                                  VerticalAlignment="Top"
                                  Orientation="Vertical">
                        <DockPanel LastChildFill="True"
                                   Margin="0,48,0,0">
                          <Border DockPanel.Dock="Left"
                                  BorderBrush="White"
                                  BorderThickness="2"
                                  CornerRadius="8"
                                  Width="80"
                                  Height="80"
                                  HorizontalAlignment="Left"
                                  VerticalAlignment="Top">
                            <Border.Background>
                              <ImageBrush>
                                <ImageBrush.ImageSource>
                                  <BitmapImage UriSource="vfs:///Resources/UI/Federation/AffairsScreen/InternalAffairs.png"/>
                                </ImageBrush.ImageSource>
                              </ImageBrush>
                            </Border.Background>
                          </Border>
                          <StackPanel Orientation="Vertical"
                                      Margin="12,0,0,0">
                            <TextBlock FontFamily="{DynamicResource DefaultFont}"
                                       FontSize="20pt"
                                       Foreground="{DynamicResource HeaderTextBrush}"
                                       Text="{s:StringResource Key=INTERNAL_AFFAIRS, Case=Upper}"/>
                            <TextBlock Margin="0,12,0,0"
                                       TextWrapping="Wrap"
                                       Text="{Binding Source={s:StringResource INTERNAL_AFFAIRS_DESCRIPTION}}"/>
                          </StackPanel>
                        </DockPanel>
                        <DockPanel LastChildFill="True"
                                   Margin="0,12,0,0">
                          <ToggleButton DockPanel.Dock="Left"
                                        Focusable="False"
                                        IsTabStop="False"
                                        Margin="0,0,12,0"
                                        Style="{DynamicResource LockToggleButtonStyle}"
                                        IsChecked="{Binding Path=Distribution[InternalAffairs].IsLocked, Mode=TwoWay}"/>
                          <RepeatButton DockPanel.Dock="Left"
                                        Margin="0,0,6,0"
                                        Command="{x:Static ui:BlockBar.DecrementCommand}"
                                        CommandTarget="{Binding ElementName=InternalAffairsBlockBar}"
                                        Style="{StaticResource BlockBarDecrementButtonStyle}"/>
                          <TextBlock DockPanel.Dock="Right"
                                     FontFamily="{DynamicResource DefaultFont}"
                                     FontSize="20pt"
                                     Width="50"
                                     TextAlignment="Right"
                                     Text="{Binding Path=Distribution[InternalAffairs].Value}"/>
                          <RepeatButton DockPanel.Dock="Right"
                                        Margin="6,0,0,0"
                                        Command="{x:Static ui:BlockBar.IncrementCommand}"
                                        CommandTarget="{Binding ElementName=InternalAffairsBlockBar}"
                                        Style="{StaticResource BlockBarIncrementButtonStyle}"/>
                          <ui:BlockBar x:Name="InternalAffairsBlockBar"
                                       Height="28"
                                       BlockCount="48"
                                       BlockMargin="4"
                                       Value="{Binding Path=Distribution[InternalAffairs].Value, Mode=TwoWay}"/>
                        </DockPanel>
                      </StackPanel>

                      <!-- EXTERNAL AFFAIRS -->
                      <StackPanel Grid.Row="2"
                                  VerticalAlignment="Top"
                                  Orientation="Vertical">
                        <DockPanel LastChildFill="True"
                                   Margin="0,48,0,0">
                          <Border DockPanel.Dock="Left"
                                  BorderBrush="White"
                                  BorderThickness="2"
                                  CornerRadius="8"
                                  Width="80"
                                  Height="80"
                                  HorizontalAlignment="Left"
                                  VerticalAlignment="Top">
                            <Border.Background>
                              <ImageBrush>
                                <ImageBrush.ImageSource>
                                  <BitmapImage UriSource="vfs:///Resources/UI/Federation/AffairsScreen/ExternalAffairs.png"/>
                                </ImageBrush.ImageSource>
                              </ImageBrush>
                            </Border.Background>
                          </Border>
                          <StackPanel Orientation="Vertical"
                                      Margin="12,0,0,0">
                            <TextBlock FontFamily="{DynamicResource DefaultFont}"
                                       FontSize="20pt"
                                       Foreground="{DynamicResource HeaderTextBrush}"
                                       Text="{s:StringResource Key=EXTERNAL_AFFAIRS, Case=Upper}"/>
                            <TextBlock Margin="0,12,0,0"
                                       TextWrapping="Wrap"
                                       Text="{Binding Source={s:StringResource EXTERNAL_AFFAIRS_DESCRIPTION}}"/>
                          </StackPanel>
                        </DockPanel>
                        <DockPanel LastChildFill="True"
                                   Margin="0,12,0,0">
                          <ToggleButton DockPanel.Dock="Left"
                                        Focusable="False"
                                        IsTabStop="False"
                                        Margin="0,0,12,0"
                                        Style="{DynamicResource LockToggleButtonStyle}"
                                        IsChecked="{Binding Path=Distribution[ExternalAffairs].IsLocked, Mode=TwoWay}"/>
                          <RepeatButton DockPanel.Dock="Left"
                                        Margin="0,0,6,0"
                                        Command="{x:Static ui:BlockBar.DecrementCommand}"
                                        CommandTarget="{Binding ElementName=ExternalAffairsBlockBar}"
                                        Style="{StaticResource BlockBarDecrementButtonStyle}"/>
                          <TextBlock DockPanel.Dock="Right"
                                     FontFamily="{DynamicResource DefaultFont}"
                                     FontSize="20pt"
                                     Width="50"
                                     TextAlignment="Right"
                                     Text="{Binding Path=Distribution[ExternalAffairs].Value}"/>
                          <RepeatButton DockPanel.Dock="Right"
                                        Margin="6,0,0,0"
                                        Command="{x:Static ui:BlockBar.IncrementCommand}"
                                        CommandTarget="{Binding ElementName=ExternalAffairsBlockBar}"
                                        Style="{StaticResource BlockBarIncrementButtonStyle}"/>
                          <ui:BlockBar x:Name="ExternalAffairsBlockBar"
                                       Height="28"
                                       BlockCount="48"
                                       BlockMargin="4"
                                       Value="{Binding Path=Distribution[ExternalAffairs].Value, Mode=TwoWay}"/>
                        </DockPanel>
                      </StackPanel>
                    </Grid>
                  </ScrollViewer>
                </TabItem>
              </TabControl>
            </DockPanel>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>